/**
 * @author LKQ
 * @date 2022/1/30 17:44
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        System.out.println(solution.secondHighest("abc1101"));
    }
    public int secondHighest(String s) {
        int first = -1, second = -1;
        for (char c : s.toCharArray()) {
            if ( c>= 48 && c <= 57) {
                int temp = c - '0';
                if ( temp > first) {
                    second = first;
                    first = temp;
                }else if (temp > second && temp < first) {
                    second = temp;
                }
            }
        }
        return  second;
    }
}
